/* 150 mseconds of delay */
#define LOCATION_CHANGED_TIMEOUT 150
-/* Profiling stuff */
-#undef PROFILE_FILE_CHOOSER
-#ifdef PROFILE_FILE_CHOOSER
-
-
-#ifndef F_OK
-#define F_OK 0
-#endif
-
-#define PROFILE_INDENT 4
-
-static int profile_indent;
-
-static void
-profile_add_indent (int indent)
-{
- profile_indent += indent;
- if (profile_indent < 0)
- g_error ("You screwed up your indentation");
-}
-
-static void
-_gtk_file_chooser_profile_log (const char *func, int indent, const char *msg1, const char *msg2)
-{
- char *str;
-
- if (indent < 0)
- profile_add_indent (indent);
-
- if (profile_indent == 0)
- str = g_strdup_printf ("MARK: %s %s %s", func ? func : "", msg1 ? msg1 : "", msg2 ? msg2 : "");
- else
- str = g_strdup_printf ("MARK: %*c %s %s %s", profile_indent - 1, ' ', func ? func : "", msg1 ? msg1 : "", msg2 ? msg2 : "");
-
- access (str, F_OK);
- g_free (str);
-
- if (indent > 0)
- profile_add_indent (indent);
-}
-
-#define profile_start(x, y) _gtk_file_chooser_profile_log (G_STRFUNC, PROFILE_INDENT, x, y)
-#define profile_end(x, y) _gtk_file_chooser_profile_log (G_STRFUNC, -PROFILE_INDENT, x, y)
-#define profile_msg(x, y) _gtk_file_chooser_profile_log (NULL, 0, x, y)
-#else
-#define profile_start(x, y)
-#define profile_end(x, y)
-#define profile_msg(x, y)
-#endif
-
enum {
PROP_SEARCH_MODE = 1,
PROP_SUBTITLE
{
GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (object);
- profile_start ("start", NULL);
-
G_OBJECT_CLASS (gtk_file_chooser_widget_parent_class)->constructed (object);
update_appearance (impl);
-
- profile_end ("end", NULL);
}
static void
static void
change_icon_theme (GtkFileChooserWidget *impl)
{
- profile_start ("start", NULL);
-
/* the first cell in the first column is the icon column, and we have a fixed size there */
set_icon_cell_renderer_fixed_size (impl);
clear_model_cache (impl, MODEL_COL_ICON);
gtk_widget_queue_resize (impl->browse_files_tree_view);
-
- profile_end ("end", NULL);
}
/* Callback used when a GtkSettings value changes */
{
const char *name;
- profile_start ("start", NULL);
-
name = g_param_spec_get_name (pspec);
if (strcmp (name, "gtk-icon-theme-name") == 0)
change_icon_theme (impl);
-
- profile_end ("end", NULL);
}
/* Installs a signal handler for GtkSettings so that we can monitor changes in
{
GtkSettings *settings;
- profile_start ("start", NULL);
-
if (impl->settings_signal_id)
- {
- profile_end ("end", NULL);
- return;
- }
+ return;
settings = gtk_widget_get_settings (GTK_WIDGET (impl));
impl->settings_signal_id = g_signal_connect (settings, "notify",
G_CALLBACK (settings_notify_cb), impl);
change_icon_theme (impl);
-
- profile_end ("end", NULL);
}
static void
{
GtkFileChooserWidget *impl;
- profile_start ("start", NULL);
-
impl = GTK_FILE_CHOOSER_WIDGET (widget);
- profile_msg (" parent class css_changed start", NULL);
GTK_WIDGET_CLASS (gtk_file_chooser_widget_parent_class)->css_changed (widget, change);
- profile_msg (" parent class css_changed end", NULL);
change_icon_theme (impl);
-
- profile_end ("end", NULL);
}
static void
{
GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (widget);
- profile_start ("start", NULL);
-
impl->browse_files_interaction_frozen = FALSE;
GTK_WIDGET_CLASS (gtk_file_chooser_widget_parent_class)->map (widget);
g_assert_not_reached ();
}
}
-
- profile_end ("end", NULL);
}
/* GtkWidget::unmap method */
static void
load_set_model (GtkFileChooserWidget *impl)
{
- profile_start ("start", NULL);
-
g_assert (impl->browse_files_model != NULL);
- profile_msg (" gtk_tree_view_set_model start", NULL);
gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view),
GTK_TREE_MODEL (impl->browse_files_model));
update_columns (impl, FALSE, _("Modified"));
file_list_set_sort_column_ids (impl);
set_sort_column (impl);
- profile_msg (" gtk_tree_view_set_model end", NULL);
impl->list_sort_ascending = TRUE;
g_set_object (&impl->model_for_search, impl->browse_files_model);
-
- profile_end ("end", NULL);
}
/* Timeout callback used when the loading timer expires */
{
GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (data);
- profile_start ("start", NULL);
-
g_assert (impl->load_state == LOAD_PRELOAD);
g_assert (impl->load_timeout_id != 0);
g_assert (impl->browse_files_model != NULL);
load_set_model (impl);
- profile_end ("end", NULL);
-
return FALSE;
}
GError *error,
GtkFileChooserWidget *impl)
{
- profile_start ("start", NULL);
-
if (error)
{
set_busy_cursor (impl, FALSE);
/* We can't g_assert_not_reached(), as something other than us may have
* initiated a folder reload. See #165556.
*/
- profile_end ("end", NULL);
return;
}
pending_select_files_process (impl);
set_busy_cursor (impl, FALSE);
-#ifdef PROFILE_FILE_CHOOSER
- access ("MARK: *** FINISHED LOADING", F_OK);
-#endif
-
- profile_end ("end", NULL);
}
/* Callback used when file system model adds or updates a file.
_gtk_file_system_model_get_directory (impl->browse_files_model) == impl->current_folder)
return TRUE;
- profile_start ("start", NULL);
-
stop_loading_and_clear_list_model (impl, TRUE);
set_busy_cursor (impl, TRUE);
_gtk_file_system_model_set_show_hidden (impl->browse_files_model, impl->show_hidden);
- profile_msg (" set sort function", NULL);
gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (impl->browse_files_model), MODEL_COL_NAME, name_sort_func, impl, NULL);
gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (impl->browse_files_model), MODEL_COL_SIZE, size_sort_func, impl, NULL);
gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (impl->browse_files_model), MODEL_COL_TYPE, type_sort_func, impl, NULL);
_gtk_file_system_model_set_filter (impl->browse_files_model, impl->current_filter);
- profile_end ("end", NULL);
-
return TRUE;
}
GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser);
struct UpdateCurrentFolderData *data;
- profile_start ("start", NULL);
-
g_object_ref (file);
operation_mode_set (impl, OPERATION_MODE_BROWSE);
set_busy_cursor (impl, TRUE);
g_object_unref (file);
- profile_end ("end", NULL);
return TRUE;
}
{
GtkExpression *expression;
- profile_start ("start", NULL);
-#ifdef PROFILE_FILE_CHOOSER
- access ("MARK: *** CREATE FILE CHOOSER", F_OK);
-#endif
-
impl->select_multiple = FALSE;
impl->show_hidden = FALSE;
impl->show_size_column = TRUE;
* which cannot be done with GtkBuilder
*/
post_process_ui (impl);
-
- profile_end ("end", NULL);
}
/**